<!--
 * @Date: 2022-03-04 11:07:17
 * @LastEditors: 春贰
 * @gitee: https://gitee.com/chun22222222
 * @github: https://github.com/chun222
 * @Desc: 
 * @LastEditTime: 2022-04-22 10:05:15
 * @FilePath: \web\src\App.vue
-->

<template>
  <a-config-provider :locale="antdLocal">
    <router-view></router-view>
  </a-config-provider>
</template>
<script>
import { computed, defineComponent, ref, watch } from "vue";
import { useStore } from "vuex";
import { useI18n } from "vue-i18n"; 
import dayjs from 'dayjs';
import 'dayjs/locale/zh-cn';   //必须  引入 时间才能正确翻译 


export default defineComponent({
  name: "App",
  setup() {
  
    const store = useStore();
    const defaultLang = computed(() => store.getters.language);
    const color = computed(() => store.getters.color); 

    //  const antdLocal2 = computed(() => {
    //     return defaultLang.value=='zh-CN'?zhCN:enUS ;
    //   }) 
    const antdLocal = 
      computed(() => {
        const { getLocaleMessage } = useI18n({ useScope: "global" }); 
        return getLocaleMessage(defaultLang.value).antLocal;
      }) ;
 
    return {
      antdLocal, 
    };
  },
});
</script>
<style>
#app,
body,
html {
  height: 100%;
}
</style>